<!-- include tpl=head_lay title=$rs.title -->
<script type="text/javascript" src="{func include_js list.js}"></script>
<input type="hidden" name="pid" id="pid" value="{$pid}" />
<!-- if $project_list -->
<div class="layui-card" phpok-id="JS_PROJECT">
	<div class="layui-card-header">{lang子项信息，请点击操作} <span class="red">{$rs.title}</span></div>
	<div class="layui-card-body">
		<ul class="project" id="project">
			<!-- loop from=$project_list key=$key value=$value -->
			<li id="project_{$value.id}" title="{$value.title}" status="{$value.status}" href="{url ctrl=list func=action id=$value.id/}">
				<div class="img"><img src="{$value.ico ? $value.ico : 'images/ico/default.png'}" /></div>
				<div class="txt" id="txt_{$value.id}">{$value.nick_title ? $value.nick_title : $value.title}</div>
			</li>
			<!-- /loop -->
		</ul>
		<div class="clear"></div>
	</div>
</div>
<!-- /if -->

<!-- if $rs.module -->
<script type="text/javascript">
function list_content_search(obj)
{
	$.dialog.tips("正在搜索中，请稍候…",100).lock();
	return true;
}
</script>
<div class="layui-card" id="search_html" phpok-id="JS_SEARCH"{if !$keywords} style="display:none"{/if}>
	<div class="layui-card-header hand">
		{lang搜索}
	</div>
	<div class="layui-card-body">
		<form method="post" class="layui-form" action="{url ctrl=list func=action id=$pid/}" onsubmit="return list_content_search(this)">
		<div class="layui-row layui-col-space5 phpok-search">
			<div class="layui-col-xs12 layui-col-sm4 layui-col-md2">
				<select name="keywords[orderby_search]">
					<option value="">{lang默认排序}</option>
					<option value="hits_hot"{if $keywords && $keywords.orderby_search=='hits_hot'} selected{/if}>{lang查看次数多到少}</option>
					<option value="hits_cold"{if $keywords && $keywords.orderby_search=='hits_cold'} selected{/if}>{lang查看次数少到多}</option>
					<!-- if $rs.is_biz -->
					<option value="price_high"{if $keywords && $keywords.orderby_search=='price_high'} selected{/if}>{lang价格从高到低}</option>
					<option value="price_low"{if $keywords && $keywords.orderby_search=='price_low'} selected{/if}>{lang价格从低到高}</option>
					<!-- /if -->
					<option value="sort_max"{if $keywords && $keywords.orderby_search=='sort_max'} selected{/if}>{lang排序从高到低}</option>
					<option value="sort_min"{if $keywords && $keywords.orderby_search=='sort_min'} selected{/if}>{lang排序从低到高}</option>
					<option value="dateline_max"{if $keywords && $keywords.orderby_search=='dateline_max'} selected{/if}>{lang最后发布排在前面}</option>
					<option value="dateline_min"{if $keywords && $keywords.orderby_search=='dateline_min'} selected{/if}>{lang以前发布的排在前面}</option>
					<option value="id_max"{if $keywords && $keywords.orderby_search=='id_max'} selected{/if}>{langID值从大到小}</option>
					<option value="id_min"{if $keywords && $keywords.orderby_search=='id_min'} selected{/if}>{langID值从小到大}</option>
				</select>
			</div>
			<div class="layui-col-xs12 layui-col-sm4 layui-col-md2">
				<select name="psize">
					<option value="">{lang每页数量}</option>
					<option value="50"{if $psize2 && $psize2 == 50} selected{/if}>50</option>
					<option value="100"{if $psize2 && $psize2 == 100} selected{/if}>100</option>
					<option value="150"{if $psize2 && $psize2 == 150} selected{/if}>150</option>
					<option value="200"{if $psize2 && $psize2 == 200} selected{/if}>200</option>
					<option value="300"{if $psize2 && $psize2 == 300} selected{/if}>300</option>
				</select>
			</div>
			<div class="layui-col-xs12 layui-col-sm4 layui-col-md2">
				<select name="keywords[status]">
					<option value="">{lang状态}</option>
					<option value="1"{if $keywords && $keywords.status==1} selected{/if}>已审核</option>
					<option value="2"{if $keywords && $keywords.status==2} selected{/if}>未审核</option>
				</select>
			</div>
			<div class="layui-col-xs12 layui-col-sm4 layui-col-md2">
				<select name="keywords[hidden]">
					<option value="">{lang是否隐藏}</option>
					<option value="1"{if $keywords && $keywords.hidden==1} selected{/if}>隐藏</option>
					<option value="2"{if $keywords && $keywords.hidden==2} selected{/if}>显示</option>
				</select>
			</div>
			<!-- if $rs.is_attr -->
			<div class="layui-col-xs12 layui-col-sm4 layui-col-md2">
				<select name="keywords[attr]" id="search_attr">
					<option value="">{lang属性}</option>
					<!-- loop from=$attrlist key=$key value=$value -->
					<option value="{$key}"{if $keywords && $keywords.attr == $key} selected{/if}>{$value}</option>
					<!-- /loop -->
				</select>
			</div>
			<!-- /if -->
			<!-- if $rs.cate && $catelist -->
			<div class="layui-col-xs12 layui-col-sm4 layui-col-md2">
				<select name="keywords[cateid]">
					<option value="">{lang选择分类}</option>
					<!-- loop from=$opt_catelist key=$key value=$value -->
					<option value="{$value.id}"{if $keywords && $keywords.cateid == $value.id} selected{/if}>{$value._space}{$value.title}</option>
					<!-- /loop -->
				</select>
			</div>
			<!-- /if -->
			<div class="layui-col-xs12 layui-col-sm4 layui-col-md2">
				<input type="text" name="keywords[dateline_start]" class="layui-input" id="dateline_start" placeholder="{lang开始时间}"{if $keywords} value="{$keywords.dateline_start}"{/if} />
			</div>
			<div class="layui-col-xs12 layui-col-sm4 layui-col-md2">
				<input type="text" name="keywords[dateline_stop]" class="layui-input" id="dateline_stop" placeholder="{lang结束时间}"{if $keywords} value="{$keywords.dateline_stop}"{/if} />
			</div>
			<!-- loop from=$search_list key=$key value=$value id=$tmpid -->
			<div class="layui-col-xs12 layui-col-sm4 layui-col-md2">
				<!-- if $value.rslist -->
				<select name="keywords[{$value.identifier}]">
					<option value="">请选择…</option>
					<!-- loop from=$value.rslist key=$k value=$v id=$idxx -->
					<option value="{$v.val}"{if $v.val == $keywords[$value.identifier]} selected{/if}>{$v.title}</option>
					<!-- /loop -->
				</select>
				<!-- else -->
				<input type="text" name="keywords[{$value.identifier}]" class="layui-input"{if $keywords} value="{$keywords[$value.identifier]}"{/if} placeholder="{$value.title}，{if $value.search == 1}{lang仅支持精确搜索}{else}{lang支持模糊搜索}{/if}" />
				<!-- /if -->
			</div>
			<!-- /loop -->
			<div class="layui-col-xs12 layui-col-sm4 layui-col-md2">
				<select id="key_type" name="key_type">
					<option value="title"{if $key_type == 'title'} selected{/if}>{$rs.alias_title ? $rs.alias_title : P_Lang('主题')}</option>
					<!-- if $rs.is_tag -->
					<option value="tag"{if $key_type == 'tag'} selected{/if}>{lang标签}</option>
					<!-- /if -->
					<!-- if $rs.is_userid -->
					<option value="user"{if $key_type == 'user'} selected{/if}>{lang用户}</option>
					<!-- /if -->
					<!-- if $rs.is_identifier -->
					<option value="identifier"{if $key_type == 'identifier'} selected{/if}>{lang标识}</option>
					<!-- /if -->
				</select>
			</div>
			
			<div class="layui-col-xs12 layui-col-sm4 layui-col-md2">
				<input type="text" id="key_data" name="key_data" placeholder="{lang输入搜索关键字}" class="layui-input" value="{$key_data}" />
			</div>
			<div class="layui-col-xs12 layui-col-sm4 layui-col-md2">
				<div class="layui-row">
					<div class="layui-col-xs6">
				    	<select name="keywords[_id]">
							<option value="0"{if !$keywords._id} selected{/if}>{langID} =</option>
							<option value="1"{if $keywords._id == 1} selected{/if}>{langID} &gt;</option>
							<option value="2"{if $keywords._id == 2} selected{/if}>{langID} &lt;</option>
							<!-- if $rs.subtopics -->
							<option value="3"{if $keywords._id == 3} selected{/if}>{lang父级ID}</option>
							<!-- /if -->
						</select>
					</div>
					<div class="layui-col-xs6">
						<div style="margin-left:5px;">
						<input type="text" name="keywords[id]" value="{$keywords[id]}" class="layui-input" placeholder="{langID 数值}" />
						</div>
					</div>
				</div>
			</div>
			<div class="layui-col-xs12 layui-col-sm4 layui-col-md2">
				<div class="layui-btn-group">
					<input type="submit" value="{lang搜索}" class="layui-btn" />
					<input type="button" value="{lang全部主题}" onclick="$.phpok.go('{url ctrl=list func=action id=$rs.id/}')" class="layui-btn layui-btn-warm" />
				</div>
			</div>
			<div class="layui-col-xs12 layui-col-sm4 layui-col-md2">
			</div>
		</div>
		</form>
	</div>
</div>
<!-- /if -->

<!-- if $rs.admin_note -->
<div class="layui-card">
	<div class="layui-card-body">{$rs.admin_note}</div>
</div>
<!-- /if -->
<div class="layui-card" phpok-id="JS_LIST">
	<div class="layui-card-header">
		<div class="layui-btn-group">
			<!-- if $popedom.comment && $rs.comment_status -->
			<button type="button" class="layui-btn layui-btn-sm" onclick="$.admin_list.reply_it(0)">
				{lang评论}
			</button>
			<!-- /if -->
			<!-- if $rs.subtopics && $popedom.add && $keywords._id != 3 -->
			<button type="button" onclick="$.win('{lang加子主题}_{$rs.nick_title ? $rs.nick_title : $rs.title}','{url ctrl=list func=edit pid=$rs.id/}')" title="{lang加子主题}" class="layui-btn layui-btn-sm">
				加子主题
			</button>
			<!-- /if -->
		</div>
		<span id="AP_ACTION_HTML"></span>
		<div class="layui-btn-group fr">
			<!-- if $popedom.add -->
			<button class="layui-btn layui-btn-sm layui-btn-danger" onclick="$.phpok_list.add('{$pid}','{$rs.title}','{$rs.admin-post-style}','{$rs.admin-post-width}','{$rs.admin-post-height}','{$m_rs.mtype}')"><span class="layui-icon">&#xe654;</span>{lang添加内容}</button>
			<!-- /if -->
			<!-- if $rs.module -->
			<button class="layui-btn layui-btn-sm" title="{lang搜索}" onclick="$.admin.hide_show('search_html')"><span class="layui-icon" style="margin-right:0;">&#xe615;</span> {lang搜索}</button>
			<!-- /if -->
			<!-- if $popedom.set || $session.admin_rs.if_system -->
			<button class="layui-btn layui-btn-sm" title="{lang管理自身信息，如绑定模板，改名称，自定义列表显示字段等}" onclick="$.win('{$rs.title}_#{$pid}','{url ctrl=project func=set id=$pid/}')"><span class="layui-icon">&#xe614;</span> {lang管理}</button>
			<button class="layui-btn layui-btn-sm" title="{lang扩展自身信息，如增加项目的大图等}" onclick="$.win('{$rs.title}_#{$pid}','{url ctrl=project func=content id=$pid/}')"><span class="layui-icon" style="margin-right:0;">&#xe642;</span> {lang修改}</button>
			<!-- /if -->
		</div>
	</div>
	<!-- if $rslist -->
	<div class="layui-card-body">
		<table id="tablelist" lay-filter="tablelist" data-psize="{$psize}" data-total="{$total}" data-ftype="{$m_rs.id}" data-totalRow="{$rs.admin-list-stat}" lay-data="{escape: false}">
		<thead>
		<tr>
			<th lay-data="{field:'_id', width:50,type:'checkbox',fixed:'left',unresize:true}"></th>
			<th lay-data="{field:'status', width:50,fixed:'left',unresize:true}"></th>
			<th lay-data="{field:'id', width:70,fixed:'left',sort:true,align:'center'}">ID</th>
			<th lay-data="{field:'title',minWidth:180,sort:true}">{$rs.alias_title ? $rs.alias_title : P_Lang('主题')}</th>
			<!-- if $rs.is_biz -->
			<th lay-data="{field:'price', minWidth:110,sort:true,align:'left'}">{lang价格}</th>
			<!-- /if -->
			<!-- if $rs.cate -->
			<th lay-data="{field:'cate_id', width:120,align:'center'}">{lang主分类}</th>
			<!-- /if -->
			<!-- loop from=$layout key=$key value=$value -->
			<th lay-data="{field:'{$key}'{if $value.width},width:{$value.width}{/if}{if $popedom.modify},edit:{$value.edit}{/if},sort:{$value.sort},align:'{$value.align}',totalRow:{$value.stat}{if $value.stat_title},totalRowText:'{$value.stat_title}'{/if}}">{$value.title}</th>
			<!-- /loop -->
			<th lay-data="{field:'_action', width:150,align:'left',fixed:'right',unresize:true}">{lang操作}</th>
		</tr>
		</thead>
		<!-- loop from=$rslist key=$key value=$value id=$tmpid -->
		<tr id="list_{$value.id}" class="layui-tips" title="{$rs.alias_title ? $rs.alias_title : P_Lang('主题')}: {$value.title}&#10;{lang日期}: {func date 'Y-m-d H:i:s' $value.dateline}">
			<td class="center"><input type="checkbox" class="ids" name="ids[]" id="id_{$value.id}" value="{$value.id}" /></td>
			<td><span class="status{$value.status}" id="status_{$value.id}" {if $popedom.status}onclick="$.admin_list.status({$value.id},this)"{else} style="cursor: default;"{/if} data-value="{$value.status}"></span></td>
			<td class="center">{$value.id}</td>
			<td>
				<!-- if $value.attr -->
					<!-- php:$attr = explode(",",$value['attr']) -->
					<!-- loop from=$attr key=$attr_k value=$attr_v -->
					<a href="{url ctrl=list func=action id=$pid/}&keywords[attr]={$attr_v}" class="red size10">[{$attrlist[$attr_v]}]</a> 
					<!-- /loop -->
				<!-- /if -->
				<label for="id_{$value.id}">{$value.title}</label>
				<!-- if $value.identifier -->
				<span class="gray i">（{$value.identifier}）</span>
				<!-- /if -->
				<!-- if $value.hidden -->
				<small class="red i">(隐藏)</small>
				<!-- /if -->
			</td>
			<!-- if $rs.is_biz -->
			<td><!-- if $value.price -->{func price_format $value.price $value.currency_id}<!-- /if --></td>
			<!-- /if -->
			<!-- if $rs.cate -->
			<td class="gray center">
				<!-- if $value.cate_id && is_array($value.cate_id) -->
				<a href="{url ctrl=list func=action id=$pid/}&keywords[cateid]={$value.cate_id.id}">{$value.cate_id.title}</a>
				<!-- else -->
				{lang未设分类}
				<!-- /if -->
				<!-- if $clist && $clist[$value.id] -->
				<div class="extcate">
					<!-- loop from=$clist[$value.id] key=$ck value=$cv -->
					<a href="{url ctrl=list func=action id=$pid/}&keywords[cateid]={$cv}" class="i">{$cateall[$cv]}</a> 
					<!-- /loop -->
				</div>
				<!-- /if -->
			</td>
			<!-- /if -->
			
			<!-- loop from=$layout key=$k value=$v -->
				<!-- if $k == "dateline" -->
				<td class="center">{func date "Y-m-d H:i" $value.dateline}</td>
				<!-- elseif $k == "hits" -->
				<td class="center">{$value.hits}</td>
				<!-- elseif $k == 'sort' -->
				<td class="center">{$value.sort}</td>
				<!-- elseif $k == "user_id" -->
				<td>{$value._user ? $value._user : '-'}</td>
				<!-- else -->
					<!-- if is_array($value[$k])  -->
						<!-- php:$c_list = $value[$k]['_admin'] -->
						<!-- if $c_list.type == 'pic' -->
						<td><img src="{$c_list.info}" width="28px" height="28px" border="0" class="hand" onclick="preview_attr('{$c_list.id}')" style="border:1px solid #dedede;padding:1px;" /></td>
						<!-- else -->
							<!-- if is_array($c_list.info) -->
							<td>{echo implode(' / ',$c_list.info)}</td>
							<!-- else -->
							<td>{$c_list.info ? $c_list.info : '-'}</td>
							<!-- /if -->
						<!-- /if -->
					<!-- else -->
					<td>{$value[$k] ? $value[$k] : '-'}</td>
					<!-- /if -->
				<!-- /if -->
			<!-- /loop -->
			<td>
				<div class="layui-btn-group" name="list-content-btns" id="btn_{$value.id}" data-id="{$value.id}">
					<input type="button" value="{lang查看}" onclick="$.admin_list.preview('{$value.id}','{$rs.is_front}')" class="layui-btn layui-btn-xs layui-btn-normal" />
					<!-- if $popedom.modify -->
					<input type="button" value="{lang编辑}" onclick="$.phpok_list.edit('{$value.id}','{$pid}','{$rs.nick_title ? $rs.nick_title : $rs.title}','{$rs.admin-post-style}','{$rs.admin-post-width}','{$rs.admin-post-height}')" class="layui-btn layui-btn-xs" />
					<!-- /if -->
					<!-- if $popedom.delete -->
					<input type="button" value="{lang删除}" onclick="$.admin_list.content_del('{$value.id}')" class="layui-btn layui-btn-xs layui-btn-danger" />
					<!-- /if -->
				</div>
			</td>
		</tr>
		<!-- /loop -->
		</table>
		<div style="margin-top:10px;" phpok-id="JS_BATCH">
		<ul class="layout">
			<li>
				<div class="layui-btn-group">
					<input type="button" value="{lang全选}" class="layui-btn layui-btn-primary layui-btn-sm" onclick="$.checkbox.all()" />
					<input type="button" value="{lang全不选}" class="layui-btn layui-btn-primary layui-btn-sm" onclick="$.checkbox.none()" />
					<input type="button" value="{lang反选}" class="layui-btn layui-btn-primary layui-btn-sm" onclick="$.checkbox.anti()" />
				</div>
			</li>
			<li><select id="list_action_val" onchange="update_select()">
				<option value="">{lang选择要执行的动作…}</option>
				<!-- if $opt_catelist -->
				<optgroup label="{lang分类操作}">
					<!-- loop from=$opt_catelist key=$key value=$value -->
					<option value="cate:{$value.id}">{$value._space}{$value.title}</option>
					<!-- /loop -->
				</optgroup>
				<!-- /if -->
				<!-- if $rs.is_attr -->
				<optgroup label="{$rs.alias_title ? $rs.alias_title : P_Lang('主题')}{lang属性}">
					<!-- loop from=$attrlist key=$key value=$value -->
					<option value="attr:{$key}">{$value} {$key}</option>
					<!-- /loop -->
				</optgroup>
				<!-- /if -->
				<optgroup label="其他">
					<!-- if $sys.copy_status -->
					<option value="copy">{lang复制}</option>
					<!-- /if -->
					<!-- if $popedom.status -->
					<option value="status">{lang审核}</option>
					<option value="unstatus">{lang取消审核}</option>
					<!-- /if -->
					<option value="hidden">{lang隐藏}</option>
					<option value="show">{lang显示}</option>
					<!-- if $popedom.delete -->
					<option value="delete">{lang删除}</option>
					<!-- /if -->
					<!-- if $popedom.modify && $rs.subtopics -->
					<option value="set_parent">{lang绑定父层}</option>
						<!-- if $keywords && $keywords._id == 3 -->
						<option value="unset_parent">{lang取消父层}</option>
						<!-- /if -->
					<!-- /if -->
				</optgroup>
				</select>
			</li>
			<li id="attr_set_li" class="hide">
				<select name="attr_set_val" style="margin-top:0px;" id="attr_set_val">
					<option value="add">{lang添加}</option>
					<option value="delete">{lang移除}</option>
				</select>
			</li>
			<!-- if $opt_catelist -->
			<li id="cate_set_li" class="hide">
				<select name="cate_set_val" style="margin-top:0px;" id="cate_set_val">
					<!-- if $rs.cate_multiple -->
					<option value="add">{lang添加扩展分类}</option>
					<option value="delete">{lang移除分类绑定}</option>
					<!-- /if -->
					<option value="move">{lang移动主分类}</option>
				</select>
			</li>
			<!-- /if -->
			<li id="plugin_button"><input type="button" value="{lang执行操作}" onclick="list_action_exec()" class="layui-btn layui-btn-sm" /></li>
		</ul>
		</div>
		<div class="center"><!-- include tpl=pagelist --></div>
	</div>
	<!-- /if -->
</div>
<!-- include tpl=foot_lay -->
